<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
//后台路由文件
require_once  app_path('Http/Route').'/admin.php';


Route::get('/', function () {
    return view('welcome');
});




Route::post('t1', function () {
    echo 'post';
    /* echo "<pre>";
     print_r(get_included_files());*/
});
//get
Route::get('t1', function () {
    echo 'hello';
    /* echo "<pre>";
     print_r(get_included_files());*/
});

//any
Route::any('t2', function () {
    echo 'any';
    /* echo "<pre>";
     print_r(get_included_files());*/
});
//可选参数
Route::any('t3/{name?}', function ($name='186') {
    echo $name;
});
//参数限制
Route::get('t3/{name?}', function ($name='186') {
    echo $name;
})->where('name','[a-z]+');

//访问控制器
Route::get('t4/{num}','ArticleController@say');

//隐士控制器
Route::controller('t5','ArticleController');

//基本路由
// Route::get('/hello', function () {
//     return "hello world!!!";
// });
// //地址基恩路由
// Route::get('/hello1', function () {
//     return url("aa");
// });

// //带参数的路由
// Route::get("/hello/{id}",function($id){
// 	return "参数路由ID··".$id;
// });
// //可选参数路由
// Route::get("/demo/{id?}",function($id=0){
// 	return "可选参数路由ID··".$id;
// });
// //
// Route::get("/demo1",["as"=>"profile",function(){
// 	return url("profile");
// }]);
// //通过URL访问控制和方法
// Route::get("/photo","photoController@index");

// Route::get("/photo/test","photoController@test");

// Route::get("/photo/getList","photoController@getList");

// Route::get("/new/delete/{id}","NewController@delete");
// Route::post("/new/update","NewController@update");
// //资源路由
// Route::resource("new","NewController");

// //加载后台页面路由
// Route::resource("/admin","Admin\IndexController@index");

Route::resource("art","ArticleController");

//登录注册路由
// 认证路由...
Route::get('auth/login', 'Auth\AuthController@getLogin');
Route::post('auth/login', 'Auth\AuthController@postLogin');
Route::get('auth/logout', 'Auth\AuthController@getLogout');
// 注册路由...
Route::get('auth/register', 'Auth\AuthController@getRegister');
Route::post('auth/register', 'Auth\AuthController@postRegister');
